package com.java_foundation.huawei.Test_6;

import java.util.Scanner;

/**
 * @program: java_foundation
 * @description: 功能:输入一个正整数，按照从小到大的顺序输出它的所有质因子（重复的也要列举）（如180的质因子为2 2 3 3 5 ）
 * 最后一个数后面也要有空格
 * @author: xiongbangwen <Email>xiongbangwen@163.com</Email>
 * @create: 2020-08-02 22:09
 **/
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long num;
        String str = "";
        int a = 2;
        while (sc.hasNext()) {
            num = sc.nextLong();
            while (num != 1) {
                while (num % a == 0) {
                    num = num / a;
                    str = str + a + " ";
                }
                a++;
            }
            System.out.println(str);
        }
    }
}
